﻿using System.Collections.Generic;
using System.Windows.Input;

namespace HeritageAcademy.Models.ViewModels
{
    /// <summary>
    /// Courses data handler.
    /// </summary>
    public class CoursesConfigViewModel
    {
        #region Methods

        /// <summary>
        /// Select appropriate courses from database according to filters.
        /// </summary>
        /// <param name="subject">Subject string</param>
        /// <param name="userId">User id string</param>
        /// <param name="handler">Click on menu item handler</param>
        /// <returns>List of courses as CourseMainMenuItem's</returns>
        public List<string> SelectCourses(string subject, string userId, MouseButtonEventHandler handler)
        {
            var menuList = new List<string>();

            return menuList;
        }

        public string GetStudentProgress(string currentUserId, string courseTitle)
        {
            var progress = string.Empty;
            
            //foreach (var t1 in 
            //    coursesData.CoursesData.CourseData.Where(
            //       t => t.CourseId == GetCourseId(courseTitle)).SelectMany(t => t.Student.Where(t1 => t1.Id == currentUserId)))
            //{
            //    progress = (t1.Progress * 100) + " %";
            //}

            return progress;
        }

        #endregion
    }
}
